package cn.edu.nju.ws.sview.views.listener;

import java.util.Timer;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class RecoverAuthorityListener implements ServletContextListener{
    private Timer timer = null;
    
    public void contextInitialized(ServletContextEvent event){
    	timer  = new Timer(true);
    	
    	timer.schedule(new AuthoriyRecoveryTask(),0,AuthoriyRecoveryTask.RECOVERY_MINUTE*60*1000);
    	
    }
    
    public void contextDestroyed(ServletContextEvent event){
    	timer.cancel();
    }
}
